import type { AddCardParams, CardListData, CardListParams } from "@/types/card";
import { request } from "@/utils/reuqest";

/**
 * /**
 * 获取月卡管理列表
 * @param { page: 1, pageSize: 10 }
 * @returns { rows: [], total: 0 }
 * */ 
export const getCardListAPI = (params: CardListParams) => request<CardListData>('/parking/card/list', 'get', params)

/**
 * 添加月卡
 * */ 
export const addCardAPI = (data: AddCardParams) => request('/parking/card', 'POST', data)

// 编辑月卡
export const editCardAPI = (data: AddCardParams) => request('/parking/card/edit', 'PUT', data)

// 获取月卡详情
export const getCardDetailAPI = (id: string) => request<AddCardParams>(`/parking/card/detail/${id}`, 'GET')

// 批量删除月卡
export const deleteCardAPI = (ids: number[]) => request(`/parking/card/${ids.join(',')}`, 'DELETE')